import { getUserSession } from 'services/EnterpriseCertificationListService'
export default {
    namespace: 'PersonalCertificaModel',
    state: {},
    reducers: {},
    effects: {
        //去获取用户的wsid
        *getUserWsid({ payload, callback }, { call, put }) {
            let res = yield call(getUserSession, payload)
            let { code } = res
            let reg = new RegExp(/0000$/, 'i')
            //如果请求成功
            if(reg.test(code)) {
                let { session: { userWsid } } = res
                yield callback('success', userWsid)
            } else {
                yield callback('error')
            }
        }
    }
}
